<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ taglib uri="/WEB-INF/tlds/att.tld" prefix="att"%>
<html lang="zh-CN">
<head>
<title>打印页</title>
<meta charset="utf-8"></meta>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="static/lib/jquery/1.9.1/jquery-1.9.1.min.js"
	type="text/javascript"></script>
<link href="static/lib/bootstrap/3.0.2/css/bootstrap.min.css"
	type="text/css" rel="stylesheet" />
<link href="static/lib/bootstrap/3.0.2/css/bootstrap-theme.css"
	type="text/css" rel="stylesheet" />
<script src="static/lib/bootstrap/3.0.2/js/bootstrap.min.js"
	type="text/javascript"></script>
<link href="static/css/layout.css" type="text/css" rel="stylesheet" />

<script type="text/javascript">			
						 $(document).ready(function (){
							  var http_request = false;
					        function createXmlRequest() {
						       if (window.ActiveXObject) { // IE浏览器
							try {
								http_request = new ActiveXObject("Msxml2.XMLHTTP");
							}                           
							catch (e) {
								try {
									http_request = new ActiveXObject("Microsoft.XMLHTTP");
								}
								catch (e) {
								}
							}
						} else {
							if (window.XMLHttpRequest) { //Mozilla 浏览器
								http_request = new XMLHttpRequest();
								if (http_request.overrideMimeType) {//设置MiME类别
									http_request.overrideMimeType("text/xml");
								}
							}
						}
					}          
						

					});
						 
						  function doPrint(){
					          bdhtml=window.document.body.innerHTML;    
					          sprnstr="<!--startprint-->";    
					          eprnstr="<!--endprint-->";    
					          prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17);    
					          prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));    
					          window.document.body.innerHTML=prnhtml;   
					          window.print();
					          setTimeout('window.close()', 5000);
					    }
</script>
</head>
<body>
<!--startprint-->
	<div style="background: #FFF; width: 100%">
		<div>
			<h3 class="center">联营结算单明细</h3>
			<table class="table o-l-table table-bordered" id="table1" style="font-size: 13.5px">
				<tbody>
					<tr>
						<td class="text-left" style="width: 20%">结算单号:</td>
						<td style="width: 30%">${stmCounter.billNo}</td>
						<td class="text-left" style="width: 20%">供应商名称:</td>
						<td style="width: 30%">${stmCounter.supplierName}</td>
						
					</tr>
					<tr>
						<td class="text-left" style="width: 20%">供应商编号:</td>
						<td style="width: 30%">${stmCounter.supplierNo}</td>

						<td class="text-left" style="width: 20%">公司名称:</td>
						<td style="width: 30%">${stmCounter.companyName}</td>
					</tr>
					<tr>
						<td class="text-left" style="width: 20%">结算期间:</td>
						<td style="width: 30%"><fmt:formatDate
								value="${stmCounter.startTime}" pattern=" yyyy-MM-dd" />&nbsp;&nbsp;至&nbsp;&nbsp;<fmt:formatDate
								value="${stmCounter.endTime}" pattern="yyyy-MM-dd" /></td>

						<td class="text-left" style="width: 20%">供应商合同号:</td>
						<td style="width: 30%">${stmCounter.contractNumber}</td>
					</tr>
					<tr>
						<td class="text-left" style="width: 20%">会员卡折让金额:</td>
						<td style="width: 30%">${stmCounter.vipDiscount}</td>

						<td class="text-left" style="width: 20%">本期合同成本:</td>
						<td style="width: 30%">${stmCounter.contractCost}</td>
					</tr>
					<tr>
						<td class="text-left" style="width: 20%">本期折扣分摊:</td>
						<td style="width: 30%">${stmCounter.discountAllocation}</td>

						<td class="text-left" style="width: 20%">本期实际成本:</td>
						<td style="width: 30%">${stmCounter.actualCost}</td>
					</tr>
					<tr>
						<td class="text-left" style="width: 20%">本期扣款:</td>
						<td style="width: 30%">${stmCounter.deductMoney}</td>

						<td class="text-left" style="width: 20%">本期实付金额:</td>
						<td style="width: 30%">${stmCounter.amountPaid}</td>
					</tr>
					<tr>
						<td class="text-left" style="width: 20%">本期返利金额:</td>
						<td style="width: 30%"><fmt:formatNumber
												value="${stmCounter.bebate}" pattern="##.##"
												minFractionDigits="2"></fmt:formatNumber></td>

						<td class="text-left" style="width: 20%">本期销售额:</td>
						<td style="width: 30%"><fmt:formatNumber
												value="${stmCounter.sales}" pattern="##.##"
												minFractionDigits="2"></fmt:formatNumber></td>
					</tr>
				</tbody>
			</table>
		</div>
		<div>
		<h4>
			扣款明细
		</h4>
			<table
				class="table table-striped table-hover o-l-table table-bordered"
					id="table1" style="font-size: 13.5px;text-align: center;">
				<thead>
					<tr>
						<th style="width:23%">扣款项目</th>
						<th style="width:23%">扣款金额</th>
						<th style="width:23%">实扣金额</th>
						<th style="width:31%">备注</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${stmCounter.statementPaymentDetails}"
						var="itemCode" varStatus="var">
						<tr>
							<td>${itemCode.costName}</td>
							<td>${itemCode.shouldDeductAmount}</td>
							<td>${itemCode.realDeductAmount}</td>
							<td>${itemCode.auditingRemark}</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
	</div>
	<!--endprint-->
		<div style="width: 75%" align="center">
			<button class="btn btn-default btn_5" onClick="doPrint();">
				打印</button>
			<button class="btn btn-default btn_5" onClick="window.close();">
				关闭</button>
		</div>
</body>
</html>